package com.xtq.countclass.controller;

import com.baomidou.mybatisplus.extension.api.R;
import com.xtq.countclass.dao.RecordDao;
import com.xtq.countclass.entity.Groupe;
import com.xtq.countclass.entity.Record;
import com.xtq.countclass.entity.User;
import com.xtq.countclass.service.UserService;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * 学生表;(User)表控制层
 *
 * @author makejava
 * @since 2024-03-06 00:10:28
 */
@RestController
@RequestMapping("record")
public class RecordController {
	/**
	 * 服务对象
	 */
	@Resource
	private RecordDao recordDao;
	
	
	/**
	 * 测试接口
	 */
	@GetMapping("/test")
	public String test() {
		return "get请求测试成功";
	}
	
	/**
	 * 查全部
	 */
	@GetMapping("/queryAll")
	public ResponseEntity<List<Record>> queryByGroup() {
		return ResponseEntity.ok(this.recordDao.queryAll());
	}
	
	@GetMapping("/nameLike/{key}")
	public ResponseEntity<List<Record>> queryLikeName(@PathVariable String key) {
		return ResponseEntity.ok(this.recordDao.queryByKey(key));
	}
	
	
	
	
}
